<?php
$ablDAO = new albumDAO();

$page = intval($_GET['page']);

if($page < 1)
    $page = 1;
    
$typeId = intval($_GET['typeid']);

$limit = 3;

$conditions = array();

$offset = $limit * ($page - 1);

$typeDTO['name'] = '';

if($typeId)
{
    $conditions['typeId'] = $typeId;
    
    $typeDAO = new typeOfPictureDAO();
    $typeDTO = $typeDAO->selectById($typeId);
}

$listAlbum = $ablDAO->getListAlbum($conditions, $offset, $limit);

$maxPage = ceil($listAlbum['total'] / $limit);

include VIEWS_PATH . DS . 'album-category.php';
?>